#!/bin/bash
set -o errexit # Set the shell option to exit on error

DIRNAME=`dirname $0`
source ${DIRNAME}/action_functions.bash
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
plain='\033[0m'


function createConfig(){
  mkdir -p ~/.pip
  cat << EOF > ~/.pip/pip.conf
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host = mirrors.aliyun.com
EOF

}


function deal(){

  if [ ! -f ~/.pip/pip.conf ] ;then
     createConfig
  fi
  python3 -m pip install --upgrade pip  > /dev/null 2>&1
  pip3 install --no-cache-dir setuptools_rust setuptools cffi > /dev/null 2>&1
	
}

function main(){
  action $0 deal
}

main $*
